$(function(){
	
	var btna1 =$("#header .hezuo dd .btn_a1 ");
	var btna2 =$("#header .hezuo dd .btn_a2 ");
	if(getCookie("true")=="true"){
		
		btna1.text("您好！"+getCookie("name"));
		btna2.text("退出").css({"color":"#333"},{"fontWeight":"bold"});
		btna2.attr("href","javascript:;");
	}else{
		btna1.text("[登录]").css({"color":"#333"},{"fontWeight":"bold"}).attr("href","denglu.html");
		btna2.text("[注册]").css({"color":"#333"},{"fontWeight":"bold"}).attr("href","denglu.html")
	}
	
	btna2.click(function(){
		//setCookie("name",false,setCookieDate(7));
		setCookie("true",false,setCookieDate(7));
		btna1.text('[登录]').css({"color":"#333"},{"fontWeight":"bold"}).attr("href","javascript:;");
		btna2.text('[注册]').css({"color":"#333"},{"fontWeight":"bold"}).attr("href","javascript:;");
		btna1.click(function(){
			window.location.href ="denglu.html";
		})
		
		btna2.click(function(){
			window.location.href ="denglu.html";
		})
	})
})
//var register_btn = $("#header .center .register_btn a");
//	if(getCookie("true")=="true"){
//		login_btn.text("您好！"+getCookie("user"));
//		//login_btn.attr("href","javascript:;");
//		register_btn.text("退出").css("color","#EE0011");
//		register_btn.attr("href","javascript:;");	
//	}else{
//		login_btn.text("登录").css("color","#EE0011").attr("href","html/login.html");
//		register_btn.text("注册").css("color","#EE0011").attr("href","html/register.html");	
//	}
//	register_btn.click(function(){
//		setCookie("true",false,setCookieDate(7),"/");
//		login_btn.text("登录").css("color","#EE0011").attr("href","javascript:;");
//		register_btn.text("注册").css("color","#EE0011").attr("href","javascript:;");
//		login_btn.click(function(){
//			window.location.href = "html/login.html";
//		});
//		register_btn.click(function(){
//			window.location.href = "html/register.html";
//		})
//	})